package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.AutoFill;
import com.ruoyi.common.enums.AutoFillType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DispatchPressureAlarmInformationMapper;
import com.ruoyi.system.domain.DispatchPressureAlarmInformation;
import com.ruoyi.system.service.IDispatchPressureAlarmInformationService;

/**
 * 压力告警信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-02
 */
@Service
public class DispatchPressureAlarmInformationServiceImpl implements IDispatchPressureAlarmInformationService 
{
    @Autowired
    private DispatchPressureAlarmInformationMapper dispatchPressureAlarmInformationMapper;

    /**
     * 查询压力告警信息
     * 
     * @param pressureAlarmInformationId 压力告警信息主键
     * @return 压力告警信息
     */
    @Override
    public DispatchPressureAlarmInformation selectDispatchPressureAlarmInformationByPressureAlarmInformationId(Long pressureAlarmInformationId)
    {
        return dispatchPressureAlarmInformationMapper.selectDispatchPressureAlarmInformationByPressureAlarmInformationId(pressureAlarmInformationId);
    }

    /**
     * 查询压力告警信息列表
     * 
     * @param dispatchPressureAlarmInformation 压力告警信息
     * @return 压力告警信息
     */
    @Override
    public List<DispatchPressureAlarmInformation> selectDispatchPressureAlarmInformationList(DispatchPressureAlarmInformation dispatchPressureAlarmInformation)
    {
        return dispatchPressureAlarmInformationMapper.selectDispatchPressureAlarmInformationList(dispatchPressureAlarmInformation);
    }

    /**
     * 新增压力告警信息
     * 
     * @param dispatchPressureAlarmInformation 压力告警信息
     * @return 结果
     */
    @AutoFill(operation = AutoFillType.INSERT)
    @Override
    public int insertDispatchPressureAlarmInformation(DispatchPressureAlarmInformation dispatchPressureAlarmInformation)
    {
        dispatchPressureAlarmInformation.setCreateTime(DateUtils.getNowDate());
        return dispatchPressureAlarmInformationMapper.insertDispatchPressureAlarmInformation(dispatchPressureAlarmInformation);
    }

    /**
     * 修改压力告警信息
     * 
     * @param dispatchPressureAlarmInformation 压力告警信息
     * @return 结果
     */
    @AutoFill(operation = AutoFillType.UPDATE)
    @Override
    public int updateDispatchPressureAlarmInformation(DispatchPressureAlarmInformation dispatchPressureAlarmInformation)
    {
        return dispatchPressureAlarmInformationMapper.updateDispatchPressureAlarmInformation(dispatchPressureAlarmInformation);
    }

    /**
     * 批量删除压力告警信息
     * 
     * @param pressureAlarmInformationIds 需要删除的压力告警信息主键
     * @return 结果
     */
    @Override
    public int deleteDispatchPressureAlarmInformationByPressureAlarmInformationIds(Long[] pressureAlarmInformationIds)
    {
        return dispatchPressureAlarmInformationMapper.deleteDispatchPressureAlarmInformationByPressureAlarmInformationIds(pressureAlarmInformationIds);
    }

    /**
     * 删除压力告警信息信息
     * 
     * @param pressureAlarmInformationId 压力告警信息主键
     * @return 结果
     */
    @Override
    public int deleteDispatchPressureAlarmInformationByPressureAlarmInformationId(Long pressureAlarmInformationId)
    {
        return dispatchPressureAlarmInformationMapper.deleteDispatchPressureAlarmInformationByPressureAlarmInformationId(pressureAlarmInformationId);
    }
}
